package yz.cp.back.common.enums;

public enum BillType {
    NULL(0,"N/A"),
    N10(10,"解冻保证金"),
    N11(11,"资金账户充值"),
    N12(12,"收款-首月还款"),
    N121(121,"收款-首月租金"),
    N13(13,"收款-月还款"),
    N131(131,"收款-月租金"),
    N14(14,"收款-一次性还款"),
    N141(141,"收款-一次性买断"),
    N15(15,"收款-提前还款"),
    N151(151,"收款-提前买断"),
    N16(16,"收到融资款"),
    N161(161,"收到融资款-线下放款"),
    N162(162,"应付融资租赁本金"),
    N17(17,"收到销售款"),
    N171(171,"收到销售款-线下放款"),
    N18(18,"收款-部分收款"),
    N181(181,"收款-部分租金"),
    N19(19,"收款-收款结清"),
    N191(191,"收款-结清买断"),
    N20(20,"冻结保证金"),
    N21(21,"资金账户提现"),
    N211(211,"保证金账户提现"),
    N22(22,"还款-部分租金"),
    N23(23,"还款-月还款"),
    N24(24,"还款-一次性还款"),
    N25(25,"还款-提前还款"),
    N26(26,"支付货款"),
    N261(261,"支付货款-线下放款"),
    N27(27,"还款-部分租金"),
    N271(271,"线下放款"),
    N28(28,"还款-部分还款"),
    N281(281,"还款-部分租金"),
    N29(29,"还款-还款结清"),
    N291(291,"还款-结清买断"),
    N60(60,"支出保费"),
    N70(70,"保费收入");
    private Integer code;
    private String name;

    BillType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static BillType getByCode(Integer code){
        for (BillType item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return BillType.NULL;
    }
}
